package logic

import (
	"cart_srv/model/redis"
	"context"

	"cart_srv/cart"
	"cart_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CartCheckLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCartCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartCheckLogic {
	return &CartCheckLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 购物车全选
func (l *CartCheckLogic) CartCheck(in *cart.CartCheckRequest) (*cart.CartCheckResponse, error) {
	// todo: add your logic here and delete this line
	redis.CartCheck(int(in.UserId), int(in.Checked))
	return &cart.CartCheckResponse{Success: true}, nil
}
